<template>
    <svg
      :class="svgClass"
    >
      <use :href="iconName"></use>
    </svg>
</template>
  ​
<script setup lang="ts">
  import { computed } from "vue";
  const props = defineProps({
    icon: {
      type: String,
      required: true,
    },
    iconClass: {
      type: String,
      default: "",
    },
  });
  const iconName = computed(() => `#icon-${props.icon}`);
  const svgClass = computed(() => {
    if (props.iconClass) return `svg-icon icon-${props.iconClass}`;
    return "svg-icon";
  });
</script>
  ​
<style scoped>
.svg-icon {
    width: 1em;
    height: 1em;
    /* fill: currentColor; */
    vertical-align: middle;
}
</style> 